home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 4
/
Mac Giga-ROM 4.0 - 1993.toast
/
FILES
/
DEV
/
I-Z
/
Progress Tube Unit.cpt
/
Progress Tube Unit Folder
/
TubeExample.c
< prev
next >
Wrap
Text File
|
1992-12-31
|
2KB
|
65 lines
/*====================================================================================*/
#include "ProgressTube.h"
main()
{
short loop,x;
TubeType Tube1,
Tube2;
Str255 String1 = "\pDoing something extremely interesting in the background...",
String2 = "\pFinishing up background tasks... ";
float PercentageA,
PercentageB;
ToolboxInit(); /* MAKE SURE everything is initialized before using this unit */
/* check below if a new window could be allocated for the tube! VERY important! */
if (NewTube( &Tube1, "\pTestTube" ) != noErr)
exit();
if (NewTube( &Tube2, "\pTestTube" ) != noErr)
exit();
MoveWindow ( Tube2.tubeWindow, defaultRect.left+60, defaultRect.top+160, TRUE );
for (loop=0; loop<=100; loop+=20)
{
if (loop> 80) strcpy(String1, String2);
PercentageA = loop * .01;
FillTube(Tube1, String1, &PercentageA);
ResetTube( Tube2 );
for (x=0; x<=100; x++)
{
PercentageB = x * .01;
FillTube(Tube2, "\pWasting time repeatedly in the foreground...", &PercentageB);
}
}
while(!Button());
DisposeTube(Tube1);
DisposeTube(Tube2);
}
ToolboxInit()
{
#define Remove_All_Events 0
InitGraf(&thePort);
InitFonts();
FlushEvents(everyEvent,Remove_All_Events);
InitWindows();
InitMenus();
TEInit();
InitDialogs(NULL);
InitCursor();
MoreMasters(); /* This reserves space for more handles */
MaxApplZone(); /* Give us room for memory allocation */
}